# include <bits/stdc++.h>
# define INF 0x7fffffff
using namespace std;

inline char getc(){
    static char buf[1 << 18], *fs, *ft;
    return (fs == ft && (ft = (fs = buf) + fread(buf, 1, 1 << 18, stdin)), fs == ft) ? EOF : *fs++;
}

inline int gn() {
    int k = 0, f = 1;
    char c = getc();
    for(; !isdigit(c); c = getc()) if(c == '-') f = -1;
    for(; isdigit(c); c = getc()) k = k * 10 + c - '0';
    return k * f;
}

double x, y, unit;
int n, a;

int main() { 
# ifdef LOCAL
    freopen("in", "r", stdin);
# endif
    n = gn(), a = gn();
    unit = (double)180 / n;
    int i = 1; //i是y的序号
    while((int)y < a) { 
        ++i;
        x = y;
        y += unit;
    }
    printf("%d %d %d", 1, n, min( ((a > ((x + y) / 2) || i == 2) ? i : --i), n - 1));
}
